package com.hecate.common.db.basedao.delete;

import com.hecate.common.db.basedao.provider.delete.HecateBaseDeleteProvider;
import com.hecate.common.db.basedo.IBase;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.annotation.RegisterMapper;

/**
 * @author 黄星星
 * @date 2020-12-17
 */
@RegisterMapper
public interface HecateDeleteByBidDao<T extends IBase> {

    @DeleteProvider(type = HecateBaseDeleteProvider.class, method = "dynamicSQL")
    int delete(@Param("cid") Long cid, @Param("bid") String bid);

    /**
     * 根据主键字段进行删除，方法参数必须包含完整的主键属性
     *
     * @param cid
     * @param bid
     * @return
     */
    @DeleteProvider(type = HecateBaseDeleteProvider.class, method = "dynamicSQL")
    int doRealDelete(@Param("cid") Long cid, @Param("bid") String bid);
}
